package com.blb.community_admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.community_admin.entity.SysDept;
import com.blb.community_admin.entity.vo.DeptVO;
import com.blb.community_admin.mapper.SysDeptMapper;
import com.blb.community_admin.service.ISysDeptService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper , SysDept> implements ISysDeptService {

    @Resource
    private SysDeptMapper sysDeptMapper;

    @Override
    public List<DeptVO> getDepts() {
        return sysDeptMapper.selectDepts();
    }

    @Override
    public List<DeptVO> getDeptsByTerm(String deptName, String status) {
        return sysDeptMapper.selectDeptsByTerm(deptName,status);
    }

    @Override
    public SysDept getDeptByuserId(long userId) {
        return sysDeptMapper.selectDeptByuserId(userId);
    }
}
